<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>我的伙伴</title>
		<script th:src="@{webjars/jquery/3.4.1/jquery.min.js}"></script>
		<script th:src="@{webjars/jquery/3.4.1/jquery.js}"></script>
		<script th:src="@{webjars/bootstrap/4.3.1/js/bootstrap.bundle.js}"></script>
		<script th:src="@{webjars/bootstrap/4.3.1/js/bootstrap.js}"></script>
		<script th:src="@{webjars/bootstrap/4.3.1/js/bootstrap.min.js}"></script>
		<link rel="stylesheet" th:href="@{webjars/bootstrap/4.3.1/css/bootstrap.css}" />
		<style>
			body {
				height: 100%;
			}

			body {
				display: -ms-flexbox;
				display: -webkit-box;
				display: flex;
				-ms-flex-align: center;
				-ms-flex-pack: center;
				-webkit-box-align: center;
				align-items: center;
				-webkit-box-pack: center;
				justify-content: center;
				padding-top: 40px;
				padding-bottom: 40px;
			}
		</style>
		<script>

		</script>
	</head>

	<body>
		<div style="width: 500px; height: 200px; margin-top: 5%">
			<h1>登录</h1>
			<form class="text-center" th:action="@{/thyLogin}" method="post">
				<div class="form-group row">
					<label for="username" class="col-sm-2 col-form-label">用户名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="username" name="username" required>
					</div>
				</div>
				<div class="form-group row">
					<label for="password" class="col-sm-2 col-form-label">密码</label>
					<div class="col-sm-10">
						<input type="password" class="form-control" id="password" name="password" required>
					</div>
				</div>
				<fieldset class="form-group">
					<div class="row">
						<legend class="col-form-label col-sm-2 pt-0">角色</legend>
						<div class="col-sm-10">
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="role" id="user" value="1" checked>
								<label class="form-check-label" for="user">用户</label>
							</div>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="role" id="admin" value="2">
								<label class="form-check-label" for="admin">管理员</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div class="form-group row">
					<div class="col-sm-10">
						<button type="submit" class="btn btn-primary btn-sm" style="width: 200px;" onclick="getUser()">登录</button>
						<a th:href="@{/register}" type="button" class="btn btn-secondary btn-sm" style="width: 200px;" >注册</a>
					</div>
				</div>
			</form>
		</div>
	</body>
</html>
